<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/admin/common/css/style_sub.jsp"></jsp:include>
<script type="text/javascript"
	src="<%=basePath%>js/lib/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/public.js"></script>
<script language="javascript">
if("${operResult}"=="true"){
	alert("操作成功");
}

function editConfig(id){
	window.location="<%=basePath%>basic/sys/config_toEditPage.action?sysConfig.id="+id;
}
function addConfig(typeid){
	window.location="<%=basePath%>/admin/basic/system/basicdata/config_add.jsp";
}
function deleteConfig(id){
	alert(id);
	if(confirm("确定要删除此项吗？删除后不可恢复。")){
		window.location="<%=basePath%>basic/sys/config_deleteConfig.action?sysConfig.id="+id;
	}
}
</script>
</head>
<body>
	<div class="searchTab">
		<form action="<%=basePath%>basic/sys/config_toConfigPage.action"
			id="form" method="post">
			<table>
				<tr>
					<th>参数名称</th>
					<td><input type="text" name="sysConfig.name"
						value="${sysConfig.name }" /></td>
					<th>参数代码</th>
					<td><input type="text" name="sysConfig.key"
						value="${sysConfig.key }" /></td>
					<td><span class="btn"><input type="submit"
							name="button" id="button" value="查询" /></span><span class="btn">
							<input type="button" name="button" id="button" value="添加"
							onclick="addConfig()" />
					</span></td>
				</tr>
			</table>
		</form>
	</div>
	<!--查询条件表格-->
	<div class="listTab">
		<table>
			<thead>
				<tr>
					<td>参数名称</td>
					<td>参数代码</td>
					<td>参数值</td>
					<td>说明</td>
					<td>是否可编辑</td>
					<td>是否可见</td>
					<td>类型</td>
					<td>操作</td>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="%{configList }">
					<tr>
						<td class="tdLeft">${name }</td>
						<td>${key }</td>
						<td>${value }</td>
						<td title="${remark }" class="tdLeft">${fn:substring(remark,1,15)}</td>
						<td><s:if test="%{editable==1}">
								<img src="<%=basePath%>style/icons/ok.png" title="可编辑" alt="可编辑" />
							</s:if> <s:elseif test="%{editable==0}">
								<img src="<%=basePath%>style/icons/pause.png" title="不可编辑"
									alt="不可编辑" />
							</s:elseif></td>
						<td><s:if test="%{visible==1}">
								<img src="<%=basePath%>style/icons/ok.png" title="可见" alt="可见" />
							</s:if> <s:elseif test="%{visible==0}">
								<img src="<%=basePath%>style/icons/pause.png" title="不可见"
									alt="不可见" />
							</s:elseif></td>
						<td>
						<s:if test="%{value_type==1}">
								数字
						</s:if> <s:elseif test="%{value_type==2}">
								字符串
						</s:elseif> <s:elseif test="%{value_type==3}">
								布尔
						</s:elseif> <s:else>
								未知
						</s:else></td>
						<td><s:if test="%{editable==1}">
								<a href="javascript:void(0);" class="modi"
									onclick="editConfig(${id});">编辑</a>
								<a href="javascript:deleteConfig(${id });" class="del">删除</a>
							</s:if></td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
	</div>
</body>
</html>
